//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.itheima.pinda.authority.entity.auth;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.pinda.authority.base.entity.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;

@TableName("pd_auth_role_org")
@ApiModel(
        value = "RoleOrg",
        description = "角色组织关系"
)
public class RoleOrg extends SuperEntity<Long> {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty("角色ID")
    @TableField("role_id")
    private Long roleId;
    @ApiModelProperty("部门ID")
    @TableField("org_id")
    private Long orgId;

    public RoleOrg(Long id, LocalDateTime createTime, Long createUser, Long roleId, Long orgId) {
        this.id = id;
        this.createTime = createTime;
        this.createUser = createUser;
        this.roleId = roleId;
        this.orgId = orgId;
    }

    public static RoleOrg.RoleOrgBuilder builder() {
        return new RoleOrg.RoleOrgBuilder();
    }

    public Long getRoleId() {
        return this.roleId;
    }

    public Long getOrgId() {
        return this.orgId;
    }

    public RoleOrg setRoleId(final Long roleId) {
        this.roleId = roleId;
        return this;
    }

    public RoleOrg setOrgId(final Long orgId) {
        this.orgId = orgId;
        return this;
    }

    public RoleOrg() {
    }

    public RoleOrg(final Long roleId, final Long orgId) {
        this.roleId = roleId;
        this.orgId = orgId;
    }

    public String toString() {
        return "RoleOrg(super=" + super.toString() + ", roleId=" + this.getRoleId() + ", orgId=" + this.getOrgId() + ")";
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof RoleOrg)) {
            return false;
        } else {
            RoleOrg other = (RoleOrg)o;
            if (!other.canEqual(this)) {
                return false;
            } else if (!super.equals(o)) {
                return false;
            } else {
                Object this$roleId = this.getRoleId();
                Object other$roleId = other.getRoleId();
                if (this$roleId == null) {
                    if (other$roleId != null) {
                        return false;
                    }
                } else if (!this$roleId.equals(other$roleId)) {
                    return false;
                }

                Object this$orgId = this.getOrgId();
                Object other$orgId = other.getOrgId();
                if (this$orgId == null) {
                    if (other$orgId != null) {
                        return false;
                    }
                } else if (!this$orgId.equals(other$orgId)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof RoleOrg;
    }

    public int hashCode() {
        Boolean PRIME = true;
        int result = super.hashCode();
        Object $roleId = this.getRoleId();
        result = result * 59 + ($roleId == null ? 43 : $roleId.hashCode());
        Object $orgId = this.getOrgId();
        result = result * 59 + ($orgId == null ? 43 : $orgId.hashCode());
        return result;
    }

    public static class RoleOrgBuilder {
        private Long id;
        private LocalDateTime createTime;
        private Long createUser;
        private Long roleId;
        private Long orgId;

        RoleOrgBuilder() {
        }

        public RoleOrg.RoleOrgBuilder id(final Long id) {
            this.id = id;
            return this;
        }

        public RoleOrg.RoleOrgBuilder createTime(final LocalDateTime createTime) {
            this.createTime = createTime;
            return this;
        }

        public RoleOrg.RoleOrgBuilder createUser(final Long createUser) {
            this.createUser = createUser;
            return this;
        }

        public RoleOrg.RoleOrgBuilder roleId(final Long roleId) {
            this.roleId = roleId;
            return this;
        }

        public RoleOrg.RoleOrgBuilder orgId(final Long orgId) {
            this.orgId = orgId;
            return this;
        }

        public RoleOrg build() {
            return new RoleOrg(this.id, this.createTime, this.createUser, this.roleId, this.orgId);
        }

        public String toString() {
            return "RoleOrg.RoleOrgBuilder(id=" + this.id + ", createTime=" + this.createTime + ", createUser=" + this.createUser + ", roleId=" + this.roleId + ", orgId=" + this.orgId + ")";
        }
    }
}
